﻿using Microsoft.Practices.Unity;

namespace NoMvvm.Unity
{
    /// <summary>
    /// Holds extension methods for Unity
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Sets up the NoMvvm Runtime class with Unity
        /// </summary>
        /// <param name="runtime"></param>
        /// <param name="container"></param>
        /// <returns></returns>
        public static Runtime SetupUnity(this Runtime runtime, IUnityContainer container)
        {
            return runtime.SetupContainer(new Adapter(container));
        }

        /// <summary>
        /// Sets up the NoMvvm Runtime class with Unity
        /// </summary>
        /// <param name="runtime"></param>
        /// <param name="adapter"></param>
        /// <returns></returns>
        public static Runtime SetupUnity(this Runtime runtime, Adapter adapter)
        {
            return runtime.SetupContainer(adapter);
        }
    }
}
